package service;

public class BidEvent extends Event {
	
	protected String userName;
	protected int auctionId;
	protected double price;
	
	public BidEvent (String type, String userName, int auctionId, double price) {
		super(type);
		this.userName=userName;
		this.auctionId=auctionId;
		this.price=price;
	}
	
	public String toString() {
		String string = this.type+": "+dateFormat.format(this.timestamp) + " - user "+this.userName;
		if(this.type.equals("BID_PLACED")) string += " placed bid ";
		if(this.type.equals("BID_OVERBID")) string += " overbid with ";
		if(this.type.equals("BID_WON")) string += " won with ";
		
		string += this.price+" on auction "+this.auctionId;
		
		return string;
	}

	public String getUserName() {
		return userName;
	}

	public int getAuctionId() {
		return auctionId;
	}

	public double getPrice() {
		return price;
	}
	
	

}
